const gulp = require('gulp');
const stylus = require('gulp-stylus');

const dir = './src/css/**/*.styl';
const index = './src/css/index.styl';

gulp.task('stylus', function() {
  return gulp.src(index)
    .pipe(stylus({
      'include css': true
    }))
    .pipe(gulp.dest('./tmp/css'));
});

gulp.task('release-stylus', function() {
  return gulp.src(index)
    .pipe(stylus({
      compress: true
    }))
    .pipe(gulp.dest('./dist/css'));
});

gulp.task('stylus-online', function() {
  gulp.series('stylus')();
  return gulp.watch(dir, gulp.series('stylus'));
});
